<%-- 
    Document   : index
    Created on : Dec 26, 2011, 7:33:14 PM
    Author     : BPT
--%>

<%@page import="java.util.List"%>
<%@page import="com.tthdhm.truyvetduongdi.pojo.VictimInfoPOJO"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="css/style.css" type="text/css" media="all" rel="stylesheet"/>
        <title>Tìm vét đường đi qua hệ thống GPS</title>
        <script type="text/javascript"
                src="http://maps.googleapis.com/maps/api/js?sensor=false">
        </script>
        <script type="text/javascript" src="js/functionJavacript.js">   
        </script>
        <script type="text/javascript" src="js/jquery-1.6.4.min.js">   
        </script>
    </head>
    <body style="width: 100%;" onload="initialize(10.775639, 106.70042)">
        <%
            if (request.getSession().getAttribute("Login") == null) {
        %>
        <div align="center">
            <div class="box" style="width: 250px;">
                <div class="loginTitle">Đăng nhập hệ thống</div>
                <form id="form1" name="loginForm" method="post" action="CustomerServlet">
                    <input type="hidden" name="action" id="action" class="Textbox" value="LoginMobile"/>
                    <div id="error"></div>
                    <p>
                        <label for="Username" class="Label">Tên đăng nhập</label>
                        <input type="text" name="txtUsername" id="txtUsername" class="Textbox"/>
                    </p>
                    <p>
                        <label for="Password" class="Label">Mật khẩu</label>
                        <input name="txtPassword" type="Password" class="Textbox" id="txtPassword"/>
                    </p>
                    <p>
                        <input type="submit" name="Login" id="Login" value="Đăng nhập" class="button" onclick="return checkValueLogin()"/>
                        <input type="submit" name="ForgetPassword" id="ForgetPassword" value="Quên mật khẩu" class="button"/>
                    </p>
                </form>   
            </div>
            <%            } else {
                List<VictimInfoPOJO> listVictim = (List<VictimInfoPOJO>) request.getSession().getAttribute("ListID");
            %>
            <div class="mainContent">
                <div class="search">
                    <form action="" method="get">
                        <table>
                            <tr>
                                <td><label for="DiaChi"><strong>Địa chỉ</strong></label>
                                    <input type="text" name="DiaChi" id="DiaChi" class="Textbox" /></td>
                                <td><img src="images/search.png" /></td>
                                <td><label for="DiaChi"><strong>Danh sách theo dõi</strong></label>
                                    <select name='txtList' id='txtList' class='ListBox' onchange="return loadTimer(this.value)">
                                        <%
                                            for (int i = 0; i < listVictim.size(); i++) {
                                        %>
                                        <option value="<%=listVictim.get(i).getTelephoneID()%>"><%=listVictim.get(i).getRelation()%></option>

                                        <%
                                            }
                                        %>
                                    </select>
                                    <script type="text/javascript">
                                        loadTimer(<%=listVictim.get(0).getTelephoneID()%>)
                                    </script>
                                </td>
                                <td class="info"><a href="Mobile?action=Logout"><strong>Đăng xuất</strong></a></td></td>
                            </tr>
                        </table>
                    </form>
                </div>
                <div id="map_canvas" style="width:100%; height:600px"></div>
                <div class="line-hor"></div>
                <div align="center">
                    <a href="#" class="button">Vị trí cuối</a>
                    <a href="#" class="button">Theo dõi</a>
                    <a href="#" class="button">Xem lại</a>
                </div>
            </div>
            <%                }
            %>
    </body>
</html>
